/*
 *  quadricCurveScene.h
 *  opencvExample
 *
 *  Created by 真鍋 大度 on 11/03/01.
 *  Copyright 2011 Rhizomatiks. All rights reserved.
 *
 */
#pragma once
#include "ofMain.h"
#include "basePattern.h"

class quadricCurveScene : public basePattern{
public:
	void setup(){		
		allocate();
		xGap = 50;		
		for (int i = 0; i < h; i++){
			for (int j = 0; j < w; j++){
				float qVal = fabs(ofMap(j % xGap, 0, xGap-1, -1, 1, true) ) ;
				unsigned char tmpval = qVal * qVal * maxGray;
				currentColorPixels[(i*w+j)*3 + 0] = tmpval;
				currentColorPixels[(i*w+j)*3 + 1] = tmpval;
				currentColorPixels[(i*w+j)*3 + 2] = tmpval;		
			}
		}
	}
	void update(){
		currentColorImage.setFromPixels(currentColorPixels, w, h);	
		count++;
	}
	void setupWhenPatternChanged(){
		count = 0;
	}
	int count;
	int xGap;
	
};